﻿@inherits AntDesignTestBase
@code {
    [Fact]
    public void Renders_basic_upload()
    {
        JSInterop.SetupVoid(JSInteropConstants.AddFileClickEventListener, _ => true);

        var cut = Context.Render(@<Upload>some content</Upload>);

        cut.MarkupMatches(
          @<span class="">
              <div class=" ant-upload ant-upload-select-text ant-upload-select" style="">
                  <div tabindex="0" class="ant-upload" style="position:relative;" data-fileid:ignore role="button">
                      <input type="file" style="display:none;" id:ignore>
                      some content
                  </div>
              </div>
              <div class="ant-upload-list ant-upload-list-text">
              </div>
          </span>);
    }

    [Fact]
    public void Renders_basic_drag()
    {
        JSInterop.SetupVoid(JSInteropConstants.AddFileClickEventListener, _ => true);

        var cut = Context.Render(@<Upload Drag>some content</Upload>);

        cut.MarkupMatches(
          @<span class="">
              <div class=" ant-upload ant-upload-select-text ant-upload-drag ant-upload-select" style="">
                <div tabindex="0" class="ant-upload" style="position:relative;" data-fileid:ignore role="button" >
                  <input type="file"  style="position: absolute;width: 100%;height: 100%;opacity: 0;top: 0;left: 0;z-index:2;" id:ignore >
                  <div class="ant-upload-drag-container">
                    some content
                  </div>
                </div>
            </div>
            <div class="ant-upload-list ant-upload-list-text"></div>
        </span>);
    }
    
    [Fact]
    public void Renders_custom_method()
    {
        JSInterop.SetupVoid(JSInteropConstants.AddFileClickEventListener, _ => true);

        var cut = Context.Render(@<Upload Method="put">some content</Upload>);

        cut.MarkupMatches(
          @<span class="">
              <div class=" ant-upload ant-upload-select-text ant-upload-select" style="">
                  <div tabindex="0" class="ant-upload" style="position:relative;" data-fileid:ignore role="button">
                      <input type="file" style="display:none;" id:ignore>
                      some content
                  </div>
              </div>
              <div class="ant-upload-list ant-upload-list-text">
              </div>
          </span>);
    }
}
